package com.lcj.crawler;

import com.geccocrawler.gecco.pipeline.Pipeline;
import com.lcj.service.CompanyRecruitInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class SaveContact implements Pipeline<ContactInformation> {

    @Resource(name="companyRecruitInfoServiceImpl")
    private CompanyRecruitInfoService companyRecruitInfoService;

    @Override
    public void process(ContactInformation contactInformation) {
        String recruitId = contactInformation.getRecruitId();
        String recruitUrl = "http://job.hnw.net/jobs/jobs-show.php?id="+recruitId;
        String contactPerson = contactInformation.getContactPerson();
        String phone = contactInformation.getPhone();
        String email = contactInformation.getEmail();
        String address = contactInformation.getAddress();
        companyRecruitInfoService.update(recruitUrl,contactPerson,phone,email,address);
    }
}
